If a static delta is generated between 2 commits with the same content,
then the delta will contain 1 part with no checksums. While useless,
this is a valid delta that shouldn't raise an assertion. If the delta
part has no checksums, then there are no objects to recreate and the
processing can be skipped.
Closes: #420
Approved by: cgwalters
n_checksums = n / OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN;
- if (G_UNLIKELY(n == 0 ||
- n > (G_MAXUINT32/OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) ||
+ if (G_UNLIKELY(n > (G_MAXUINT32/OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) ||
(n_checksums * OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN) != n))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
error))
goto out;
+ /* Skip processing for empty delta part */
+ if (state->n_checksums == 0)
+ {
+ ret = TRUE;
+ goto out;
+ }
+
state->checksums = checksums_data;
- g_assert (state->n_checksums > 0);
g_variant_get (part, "(@a(uuu)@aa(ayay)@ay@ay)",
&mode_dict,